Repository navigation
test: cover sending a Buffer Actor input as raw bytes - #1078
Merged
Merged
Conversation
Contributor
|
See more at https://github.com/apify/apify-client-js/actions/runs/36110964961#summary-107994094312 |
janbuchar
approved these changes
Sep 25, 2026
B4nan
pushed a commit
that referenced
this pull request
Sep 30, 2026
Adds a regression test for #277: `start()` with a `Buffer` input and `contentType: 'application/json'` sends the raw bytes, and the server gets the decoded JSON back. The bug itself is already gone on `v3`. `serializeBody()` from #1058 passes binary and string bodies through before it reaches `JSON.stringify`, and axios no longer re-serializes strings since #1051 set `transformRequest: []`. With the Buffer branch disabled, the new test fails with the `{ type: 'Buffer', data: [...] }` payload from the issue. Closes #277 *✍️ Drafted by Claude Code*
vdusek
added a commit
that referenced
this pull request
Oct 2, 2026
#1099) `ActorInput` was an alias for `object`, so a `Date`, `Map`, `Set` or function compiled and then went out as a wrong body or threw. It's now `Dictionary | Dictionary[] | Uint8Array`, which is the type suggested in #1054 plus `Uint8Array`. The extra member keeps raw-bytes input compiling (a `Buffer` sent with a `contentType`, see #277 and #1078). This is a breaking change for input declared as an `interface`. Interfaces get no implicit index signature, so they don't match `Dictionary`. The v3 migration guide shows the fix, either a `type` alias or a spread (`{ ...input }`). A type test pins the accepted and rejected shapes. This doesn't touch `contentType`, the other half of #1054. The platform still stores the `INPUT` record under the content type it receives. Closes: #1054 *✍️ Drafted by Claude Code*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a regression test for #277:
start()with aBufferinput andcontentType: 'application/json'sends the raw bytes, and the server gets the decoded JSON back.The bug itself is already gone on
v3.serializeBody()from #1058 passes binary and string bodies through before it reachesJSON.stringify, and axios no longer re-serializes strings since #1051 settransformRequest: []. With the Buffer branch disabled, the new test fails with the{ type: 'Buffer', data: [...] }payload from the issue.Closes #277
✍️ Drafted by Claude Code